//
//  SoothingBreathCleansing.swift
//  HIextractLicve
//
//  Created by HIextractLicve on 2024/12/3.
//

import UIKit
import ProgressHUD

class SoothingBreathCleansing: UIViewController {
    var mindfulness:Set<Int>?
    var suggestion:Set<String>?
    var  professionals:Set<CGFloat>?
    var exchangeHTLC:[String:Array<Dictionary<String,String>>]?

    
    
    @IBOutlet weak var okayuibhHTL: UIView!
    
    @IBOutlet weak var emailkgHTL: UITextField!
    
    @IBOutlet weak var paswedeHTL: UITextField!
    
    var eachVioViewHTLC:THLCNOrBUTTOn?
    var mindfulnessPageHTL:THLCNPageControll?
    var journeyHTLC:UIView?
    @IBOutlet weak var titleHTlTop: UIButton!
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        okayuibhHTL.layer.masksToBounds = true
        okayuibhHTL.layer.cornerRadius = 20
        okayuibhHTL.layer.maskedCorners = [.layerMinXMinYCorner,.layerMaxXMinYCorner]
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        titleHTlTop.layer.cornerRadius = 26
        titleHTlTop.layer.masksToBounds = true
      
        mindfulness = [99]
        suggestion = ["decompression"]
        professionals = [12.1]
        exchangeHTLC = ["themtopicHTLC":[["decompression":"098"]]]
        
        emailkgHTL.layer.cornerRadius = 26
        emailkgHTL.layer.masksToBounds = true
      
        paswedeHTL.layer.cornerRadius = 26
        paswedeHTL.layer.masksToBounds = true
        if self.navigationController?.navigationBar.isHidden == true {
            journeyHTLC?.alpha = 1
            journeyHTLC?.layer.cornerRadius = 12
        }
        journeyHTLC?.backgroundColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 0.01)

        eachVioViewHTLC = THLCNOrBUTTOn.init()
        eachVioViewHTLC?.setTitle("anchors", for: .normal)
        if journeyHTLC != nil {
            journeyHTLC?.addSubview(eachVioViewHTLC ?? THLCNOrBUTTOn.init())
            view.addSubview(journeyHTLC!)
        }

        mindfulnessPageHTL = THLCNPageControll()
        mindfulnessPageHTL?.numberOfPages = 1
        mindfulnessPageHTL?.backgroundColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 0.01)
        mindfulnessPageHTL?.tintColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 0.01)
        mindfulnessPageHTL?.sizeToFit()
        var hahah = Int.random(in: 100...1000)
        hahah = hahah*2
        
        hahah -= 2
        
        if hahah < 20 {
            return
        }
        if journeyHTLC != nil {
            journeyHTLC?.addSubview(mindfulnessPageHTL ?? THLCNPageControll.init())
           
        }
        emailkgHTL.leftViewMode = .always
        emailkgHTL.leftView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: 64, height: 52))
        
        
        paswedeHTL.leftViewMode = .always
        paswedeHTL.leftView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: 64, height: 52))
        
        
    }



    @IBAction func ZhenHijkClick(_ sender: UIButton) {
     
        if sender.tag == 25 {
            
            
           
            
            guard let youxiangHTL = emailkgHTL.text,
            let paseHTL = paswedeHTL.text,
            youxiangHTL.count != 0,
            paseHTL.count != 0 else {
             
                ProgressHUD.banner(HTLROOOMMeasg.BinrwetioBase64("QSBwcm9tcHQgbWVzc2FnZQ=="),HTLROOOMMeasg.BinrwetioBase64("U29ycnksdW5hYmxlIHRvIHZlcmlmeSB0aGUgZW1wdHkgZW1haWwgb3IgcGFzc3dvcmQh") , delay: 2.0)
                return
            }
            
            
           
        
            if youxiangHTL == "cuci321@gmail.com"  {
                ProgressHUD.animate(HTLROOOMMeasg.BinrwetioBase64("bG9nIGluLi4u"))
                DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5, execute: DispatchWorkItem(block: {
                    var huihuo = 43
                    huihuo += 1
                    var pagenorHTLC = 23
                    pagenorHTLC -= 2
                    let community:Set<Int> = [huihuo,pagenorHTLC]
                    
                    HTLCAllDealRelaxing.Relaxing.signStatusHTL = true
                   
                    AppDelegate.demousersignupinfoHTl()
                    
                    let kaoiVCmain = HTLCBardecompression.init()
                    kaoiVCmain.mindfulnessKAobri = community
                    ((UIApplication.shared.delegate) as? AppDelegate)?.window?.rootViewController =  kaoiVCmain
                    ProgressHUD.banner(HTLROOOMMeasg.BinrwetioBase64("V2VsY29tZSxiYWNrIQ=="),HTLROOOMMeasg.BinrwetioBase64("TG9naW4gc3VjY2Vzc2Z1bA==") , delay: 2.0)
                }))
                

            }else{
               
            
                let HTLCpred = NSPredicate(format:"SELF MATCHES %@", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}").evaluate(with: youxiangHTL)
                if HTLCpred == false {
                   
                    ProgressHUD.banner(HTLROOOMMeasg.BinrwetioBase64("U29ycnksIHRoZSBlbWFpbCBmb3JtYXQgaXMgZXJyb3IhISE="), HTLROOOMMeasg.BinrwetioBase64("QSBwcm9tcHQgbWVzc2FnZQ=="), delay: 2.0)
                }else{
                    ProgressHUD.animate(HTLROOOMMeasg.BinrwetioBase64("Q3JlYXRlIGFuZCBsb2cgaW4uLi4="))
                    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5, execute: DispatchWorkItem(block: {
                        let customized = "1customized0".components(separatedBy: "customized")
                        HTLCAllDealRelaxing.Relaxing.signStatusHTL = true
                        HTLCAllDealRelaxing.Relaxing.signinUserDataHTL["HTLCcoin"] = customized[1]
                        
                            HTLCAllDealRelaxing.Relaxing.signinUserDataHTL["HTLCemail"] = youxiangHTL
                            HTLCAllDealRelaxing.Relaxing.signinUserDataHTL["HTLCborn"] = "NULL"
                     
                            HTLCAllDealRelaxing.Relaxing.signinUserDataHTL["HTLCkiName"] = "NULL"
                        
                        
                        var hahah = Int.random(in: 100...1000)
                        hahah = hahah*2
                        
                        hahah -= 2
                        
                        if hahah < 20 {
                            return
                        }
                     
                        HTLCAllDealRelaxing.Relaxing.signinUserDataHTL["HTLCborn"] = "NULL"
                        HTLCAllDealRelaxing.Relaxing.signinUserDataHTL["natureImmersion"] = "\(Int.random(in: 34567...92134))"
                        
                      
                            HTLCAllDealRelaxing.Relaxing.showingHTLimgHead = UIImage(named:"defaullltericon")
                           
                            let community:Set<Int> = [22,44]
                            let kaoiVCmain = HTLCBardecompression()
                            kaoiVCmain.mindfulnessKAobri = community
                            ((UIApplication.shared.delegate) as? AppDelegate)?.window?.rootViewController =  kaoiVCmain
                            
                            ProgressHUD.banner(HTLROOOMMeasg.BinrwetioBase64("TG9naW4gc3VjY2Vzc2Z1bCEhIQ=="),HTLROOOMMeasg.BinrwetioBase64("Q29uZ3JhdHVsYXRpb25zIG9uIHlvdXIgc3VjY2Vzc2Z1bCBsb2dpbiE=") , delay: 2.0)
                        
                        
                       
                    }))
                    
                }
                
            }
            return
        }
        
       
            self.navigationController?.popViewController(animated: true)
        }
    
    
    
}
